<?php
/*
Template Name: Quality
*/
?>
<?php get_header();?>
<style>
.f-header {
	height: auto!important;
}

.parallax-bg img{
	width: auto!important;
	max-width: 200%!important;
}
</style>
<?php $the_query = new WP_Query(array('category_name'=>'certifications', 'hide_empty' => 0)); ?>
<?php if ($the_query->have_posts()) { ?>
<?php $the_query->the_post(); ?>
<h2 class=" certification-title">
	<?php 
	$category = get_the_category();
	echo $category[0]->name; 
	?>
</h2>
<?php $the_query->current_post = -1; ?>
<div id="sliderSwipe" class="swipe f-showPhone">
	<ul  class="swipe-wrap certifications">
		<?php while ($the_query->have_posts()) { ?>
		<li>
			<?php $the_query->the_post(); ?>
			<?php if (has_post_thumbnail()) {  ?>
			<div class="certf irma">
				<span class="f-hidePhone white-arrow"></span>
				<img class="swipeArrowLeft f-showPhone" src="<?php echo get_template_directory_uri(); ?>/images/swipe-arrow-left.png">
				<img class="swipeArrowRight f-showPhone"  src="<?php echo get_template_directory_uri(); ?>/images/swipe-arrow-right.png">
				<?php the_post_thumbnail(array('src'	=> $src, 'class' => " f-img ", 'alt' => trim(strip_tags($wp_postmeta->_wp_attachment_image_alt)),)); ?>
			</div>
			<?php } ?>
			<div class="certf-descp">
				<span><?php echo get_the_title(); ?></span>
				<?php the_content(); ?>
			</div>
		</li>
		<?php 
	}
	rewind_posts(); 
	?>
</ul>
</div>
<div>
	<ul class="certifications f-hidePhone">
		<?php while ($the_query->have_posts()) { ?>
		<li>
			<?php $the_query->the_post(); ?>
			<?php if (has_post_thumbnail()) {  ?>
			<div class="certf irma">
				<span class="f-hidePhone white-arrow"></span>
				<?php the_post_thumbnail(array('src'	=> $src, 'class' => " f-img ", 'alt' => trim(strip_tags($wp_postmeta->_wp_attachment_image_alt)),)); ?>
			</div>
			<?php } ?>
			<div class="certf-descp">
				<span><?php echo get_the_title(); ?></span>
				<?php the_content(); ?>
			</div>
		</li>
		<?php } ?>
	</ul>
</div>
<?php } ?>
</div><!-- f-logo-menu -->
</div><!-- f-header -->


<?php 
wp_reset_postdata();
$category = get_the_category();
if($category){
	get_template_part($category[0]->slug, 'grid');	
}
get_footer();
?>
<script>
$(document).ready(function(){
	if(window.addEventListener){
		window.addEventListener("orientationchange", function() {
			viewOrientation();
			defineQualityHeight();
		}, false);
	}else{
		window.attachEvent("orientationchange", function() {
			viewOrientation();
			defineQualityHeight();
		}, false);
	}

	defineQualityHeight();

	if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
		window.mySwipe = new Swipe(document.getElementById('sliderSwipe'), {
			startSlide : 1,
			speed : 400,
			auto : 7000,
			continuous : true,
			disableScroll : false,
			stopPropagation : false
		});
	}
});
</script>